<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
<title>UNDER ARMOUR</title>
<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>
</head>
<!-- end header -->

<body>
  <div class="page-group">
    <div class="page page-current shopping-result-page bg-light-gray">

      <div class="content">

        <div class="payment-content">

          <div class="list-block media-list no-margin">
            <div class="product-info">
              <!-- <a href="#" class="item-content shopping-content">
                <div class="item-media">
                  <img
                    src="http://gqianniu.alicdn.com/bao/uploaded/i4//tfscom/i3/TB10LfcHFXXXXXKXpXXXXXXXXXX_!!0-item_pic.jpg_250x250q60.jpg"
                    style='width: 6.8rem;'>
                </div>
                <div class="item-inner">
                  <div class="item-title-row">
                    <div class="item-title">课程名称</div>
                  </div>
                  <div class="item-subtitle">
                    <div class="">课程导师：某某某</div>
                    <div class="">上课时间：11月17日 13:00</div>
                  </div>
                  <div class="item-text">
                    <div>装备包</div>
                    <div>Tee + 水壶 + 毛巾</div>
                  </div>
                </div>
              </a>
              <div class="black-block"></div>

              <div class="details-layout">
                <p>姓名：鲁七七</p>
                <p>手机号：13888888888</p>
                <p>性别：女</p>
                <p>年龄：19</p>
                <br>
                <p>短袖尺码：XXS</p>
                <p>鞋子尺码：36</p>
                <br>
                <p>下单时间：2018年10月10日</p>
                <p>订单金额：￥999</p>
                <p>订单编号：123456789</p>
              </div> -->
            </div>
          </div>
          
          <c:if test="${userCourse.product.id eq 1}">
            <div class="list-block" style="margin: 1rem">
              <ul>
                <c:forEach var="product" items="${products}">
                  <li>
                    <c:choose>
                      <c:when test="${userCourse.usedCodeList.contains(product.code)}">
                        <label class="label-checkbox item-content">
                          <input type="checkbox" name="codes" value="${product.code}" checked="checked" disabled="disabled">
                          <div class="item-media"><i class="icon icon-form-checkbox"></i></div>
                          <div class="item-inner">
                            <div class="item-subtitle" style="color: red;">${product.name} - 已核销</div>
                          </div>
                        </label>
                      </c:when>
                      <c:otherwise>
                        <label class="label-checkbox item-content">
                          <input type="checkbox" name="codes" value="${product.code}">
                          <div class="item-media"><i class="icon icon-form-checkbox"></i></div>
                          <div class="item-inner">
                            <div class="item-subtitle">${product.name}</div>
                          </div>
                        </label>
                      </c:otherwise>
                    </c:choose>
                  </li>
                </c:forEach>
              </ul>
            </div>
          </c:if>              
          
          <c:choose>
            <c:when test="${userCourse.used}">
              <div class="content-block" style="margin: 0.75rem 0 1.75rem 0;">
                <p><a class="button button-big button-fill button-warning">已&nbsp;&nbsp;核&nbsp;&nbsp;销</a></p>
              </div>              
            </c:when>
            <c:otherwise>
              <div class="content-block" style="margin: 0.75rem 0 1.75rem 0;">
                <p><a id="verificate" class="button button-big button-fill button-success">核&nbsp;&nbsp;销</a></p>
              </div>
            </c:otherwise>
          </c:choose>    

        </div>
      </div>

    </div>
  </div>
  
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/staff/staff-verificate.js" />
  <script type="text/javascript">
    require(['page/staff/staff-verificate'], function(page) {
      page.init({
        jsConfig: JSON.parse('${jsConfig}'),
        unionid: '${userCourse.user.unionid}',
        courseId: '${userCourse.id}'
      })
    })
  </script>
  
</body>
</html>